package org.robert.export_client.excel;

import org.robert.export_client.excel.builder.WorkbookDataPathBuilder;
import org.robert.export_client.excel.builder.WorkbookDataRespBuilder;

import javax.servlet.http.HttpServletResponse;

/**
 * @Description
 * @Author robert
 * @Date 2024/1/20 0:57
 **/
public class ExcelWrite {

    // 构建顺序
    // 1. 构建workbook和流、文件名 2. 构建sheet/ 多个sheet(考虑多线程构建) ：每个sheet名  3. 构建头：多个头 通过注解 4. 构建内容
    public static WorkbookDataRespBuilder write(HttpServletResponse response, String fileName) throws Exception {
        return WorkbookDataRespBuilder.create(response, fileName);
    }

    public static WorkbookDataRespBuilder write(HttpServletResponse response) throws Exception {

        return write(response, null);
    }

    public static WorkbookDataPathBuilder write(String path) throws Exception {

        return write(path, null);
    }

    public static WorkbookDataPathBuilder write(String path, String fileName) throws Exception {

        return WorkbookDataPathBuilder.create(path, fileName);
    }

}
